[IA64] Fix for ptc.ga emulation
authorawilliam@lappy <awilliam@lappy>
Tue, 20 Jun 2006 22:05:17 +0000 (16:05 -0600)
committerawilliam@lappy <awilliam@lappy>
Tue, 20 Jun 2006 22:05:17 +0000 (16:05 -0600)
If switch to idle domain after vhpt_purge in ptc_ga emulation,
shouldn't switch rr7 and pta. Only disable VHPT needed. If no,
Smp VTi will hang whole system due to fault.

Signed-off-by: Zhang xiantao <xiantao.zhang@intel.com>
Signed-off-by: Kevin Tian <kevin.tian@intel.com>
xen/arch/ia64/xen/regionreg.c

index e51485190e63d05be49adb4e77f899e4ba39c5c1..cebed96efc9030938606adfee185090085609561 100644 (file)
@@ -345,13 +345,19 @@ void load_region_regs(struct vcpu *v)
 
 void load_region_reg7_and_pta(struct vcpu *v)
 {
-       unsigned long rr7;
+       unsigned long rr7, pta;
 
-       ia64_set_pta(VHPT_ADDR | (1 << 8) | (VHPT_SIZE_LOG2 << 2) |
-                    VHPT_ENABLED);
+       if (!is_idle_domain(v->domain)) {  
+               ia64_set_pta(VHPT_ADDR | (1 << 8) | (VHPT_SIZE_LOG2 << 2) |
+                            VHPT_ENABLED);
 
-       // TODO: These probably should be validated
-       rr7 =  VCPU(v,rrs[7]);
-       if (!set_one_rr(0xe000000000000000L, rr7))
-               panic_domain(0, "%s: can't set!\n", __func__);
+               // TODO: These probably should be validated
+               rr7 =  VCPU(v,rrs[7]);
+               if (!set_one_rr(0xe000000000000000L, rr7))
+                       panic_domain(0, "%s: can't set!\n", __func__);
+       }
+       else {
+               pta = ia64_get_pta();
+               ia64_set_pta(pta & ~VHPT_ENABLED);
+       }
 }